/**
 *  v-md-editor 插件
 */
import Vue from 'vue'

// 轻量版 start
// import VueMarkdownEditor from '@kangc/v-md-editor';
// import '@kangc/v-md-editor/lib/style/base-editor.css';
// 轻量版 end

// codemirror版 start
import VMdEditor from '@kangc/v-md-editor/lib/codemirror-editor';
import '@kangc/v-md-editor/lib/style/codemirror-editor.css';
// codemirror 编辑器的相关资源
import Codemirror from 'codemirror';
// mode
import 'codemirror/mode/markdown/markdown';
import 'codemirror/mode/javascript/javascript';
import 'codemirror/mode/css/css';
import 'codemirror/mode/htmlmixed/htmlmixed';
import 'codemirror/mode/vue/vue';
// edit
import 'codemirror/addon/edit/closebrackets';
import 'codemirror/addon/edit/closetag';
import 'codemirror/addon/edit/matchbrackets';
// placeholder
import 'codemirror/addon/display/placeholder';
// active-line
import 'codemirror/addon/selection/active-line';
// scrollbar
import 'codemirror/addon/scroll/simplescrollbars';
import 'codemirror/addon/scroll/simplescrollbars.css';

// 搜索替换
import 'codemirror/addon/search/search';
import 'codemirror/addon/search/searchcursor';
import 'codemirror/addon/dialog/dialog.css';
import 'codemirror/addon/search/matchesonscrollbar.css';

// style
import 'codemirror/lib/codemirror.css';

VMdEditor.Codemirror = Codemirror;
// codemirror版 end

// github 主题
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';


// 代码高亮引入所有语言包
import hljs from 'highlight.js';

VMdEditor.use(githubTheme, {
    Hljs: hljs,
});
Vue.use(VMdEditor);


// tip 提示插件
import createTipPlugin from '@kangc/v-md-editor/lib/plugins/tip/index';
import '@kangc/v-md-editor/lib/plugins/tip/tip.css';
// 代码行号插件 +  内容定位
import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index';
import createAlignPlugin from '@kangc/v-md-editor/lib/plugins/align';
// 表情
import createEmojiPlugin from '@kangc/v-md-editor/lib/plugins/emoji/index';
import '@kangc/v-md-editor/lib/plugins/emoji/emoji.css';
// Copy Code 快捷复制代码


VMdEditor.use(createTipPlugin());
VMdEditor.use(createLineNumbertPlugin());
VMdEditor.use(createAlignPlugin());
VMdEditor.use(createEmojiPlugin());


// v-md-editor 插件二次封装
import mdEditor from '@/components/v-md-editor/index';

Vue.component('MdEditor', mdEditor);
